package org.djj.dao;

import javax.annotation.Resource;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.djj.bean.User;
import org.djj.mapper.UserMapper;
import org.springframework.stereotype.Repository;

@Repository
public class UserDAO implements UserMapper {
	@Resource
	private SqlSessionFactory sqlSessionFactory;
	
	public Integer addUser(User user) {
		SqlSession sqlSession=sqlSessionFactory.openSession();
		UserMapper userMapper=sqlSession.getMapper(UserMapper.class);
		Integer result=userMapper.addUser(user);
		sqlSession.close();
		return result;
	}

}
